import request from '@/utils/request'



// 获取剧本列表
export const getScriptListAPI = () => {
  return request.get('/audit/script/list')
}

// 获取剧本详情
export const getScriptDetailAPI = (id: number) => {
  return request.get(`/script/get/${id}`)
}

// 更新剧本状态
export const updateScriptStatusAPI = (id: number, status: number,remark: string) => {
  return request.post(`/audit/script/status`, { id, status,remark })
}


// 结算购物车
export const checkoutCartAPI = ( shopId: number) => {
  return request.post(`/cart/checkout?shopId=${shopId}`)
}


// 添加购物车
export const addCartAPI = ( shopId: number, scriptId: number) => {
  return request.post(`/cart/add`, { shopId, scriptId })
}


// 查看当前商铺的购物车
export const getCartListAPI = ( shopId: number) => {
  return request.get(`/cart/list/${shopId}`)
}


// 删除购物车中的某项
export const deleteCartItemAPI = ( id: number) => {
  return request.delete(`/cart/${id}`)
}


// 清空购物车
export const clearCartAPI = ( shopId: number) => {
  return request.delete(`/cart/clear?shopId=${shopId}`)
}
